package org.zjkoye.crm.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.zjkoye.crm.common.Result;
import org.zjkoye.crm.entity.Usermain;

import java.util.concurrent.CompletableFuture;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zjkoye
 * @since 2024-06-23
 */
public interface UsermainService extends IService<Usermain> {

    CompletableFuture<Boolean> existsByUsername(String username);

    CompletableFuture<Boolean> existsByEmail(String email);

    CompletableFuture<Usermain> findByUsername(String username);

    //CompletableFuture<Usermain> findByLoginName(String loginName);

    CompletableFuture<IPage<Usermain>> pageList(int pageSize, int currentPage, String name);

    CompletableFuture<IPage<Usermain>> pagerecovery(int pageSize, int currentPage);

    CompletableFuture<Result<String>> add(Usermain user);

    CompletableFuture<Boolean> updateUser(Usermain user);

    CompletableFuture<Boolean> deleteById(int id);

    CompletableFuture<Usermain> getUserById(int id);

    CompletableFuture<Boolean> permission(int id);

    void recovery(int id);

    void deleteforever(int id);
}
